/*
**  CXSC is a C++ library for eXtended Scientific Computing 
**
**  Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik,
**                          Universitaet Karlsruhe, Germany
**            (C) 2000-2006 Wiss. Rechnen/Softwaretechnologie
**                          Universitaet Wuppertal, Germany
**
**  This library is free software; you can redistribute it and/or
**  modify it under the terms of the GNU Library General Public
**  License as published by the Free Software Foundation; either
**  version 2 of the License, or (at your option) any later version.
**
**  This library is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
**  Library General Public License for more details.
**
**  You should have received a copy of the GNU Library General Public
**  License along with this library; if not, write to the Free
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

// MPI-Routines for C-XSC data types
// "Packed" version: Sends data in Packed format
//
// Author: Markus Grimmer
// Date: 5.3.2006
//
// Incorporated Data Types: real, interval, rvector, ivector, rmatrix, imatrix,
//                          complex, cinterval, cvector, civector, cmatrix, cimatrix,
//                          l_real, l_interval, l_complex,
//                          l_rvector, l_ivector, l_rmatrix, l_imatrix
//                          dotprecision, idotprecision, 
//                          cdotprecision, cidotprecision
// Incorporated Communication Routines: MPI_Send, MPI_Isend, 
//                                      MPI_Recv

#ifndef _CXSC_MPICOMM_INCLUDE
#define _CXSC_MPICOMM_INCLUDE

#include <mpi.h>

#include <real.hpp>
#include <interval.hpp>
#include <rvector.hpp>
#include <ivector.hpp>
#include <rmatrix.hpp>
#include <imatrix.hpp>

#include <complex.hpp>
#include <cinterval.hpp>
#include <cvector.hpp>
#include <civector.hpp>
#include <cmatrix.hpp>
#include <cimatrix.hpp>

#include <l_real.hpp>
#include <l_interval.hpp>
#include <l_rvector.hpp>
#include <l_ivector.hpp>
#include <l_rmatrix.hpp>
#include <l_imatrix.hpp>

#include <l_complex.hpp>

#include <dot.hpp>
#include <idot.hpp>
#include <cdot.hpp>
#include <cidot.hpp>

using namespace cxsc;

// Definition of new MPI data types:

extern bool MPI_CXSC_TYPES_DEFINED;
extern MPI_Datatype MPI_CXSC_REAL;
extern MPI_Datatype MPI_CXSC_COMPLEX;
extern MPI_Datatype MPI_CXSC_INTERVAL;
extern MPI_Datatype MPI_CXSC_CINTERVAL;

int MPI_Define_CXSC_Types(void);

// **************************************************************

// MPI-Send/Recv for rmatrix:

int MPI_Send (rmatrix&, int, int, MPI_Comm);
int MPI_Recv (rmatrix&, int, int, MPI_Comm, MPI_Status*);
int MPI_Bcast(rmatrix&, int, int, MPI_Comm);
int MPI_Scatter(rmatrix&, rmatrix&, int, int, int, MPI_Comm);
int MPI_Gather(rmatrix&, rmatrix&, int, MPI_Comm);
int MPI_Allgather(rmatrix&, rmatrix&, MPI_Comm);

int MPI_Send(imatrix&, int, int, MPI_Comm);
int MPI_Recv(imatrix&, int, int, MPI_Comm, MPI_Status*);
int MPI_Gather(imatrix&, imatrix&, int, MPI_Comm);
int MPI_Scatter(imatrix&, imatrix&, int, int, int, MPI_Comm);

#endif
